// SCENARIO SCRIPT

// This is the special script for your entire scenario. It contains
// special encounters and code accessable from anywhere in the scenario. it also
// contains the code that initializes important special things in the
// scenario (like shops and names and descriptions of special items).

// You can create your own states, but you should give all of them numbers greater than
// or equal to 10.

beginscenarioscript;

variables;
int i,j,k,lvl,choice;

body;

// This is the state that is called every time the scenario is loaded,
// even when a save file in the scenario is loaded. Some things that should go here:
//    Names and descriptions of special items.
//    Names and effects of custom special abilities.
beginstate LOAD_SCEN_STATE;
//Quests
	init_quest(0,"Ritual of Registration","All adventurers must Register!");

//Special Items
	init_special_item(0,"Completed Form","A newly filled order form. Necessary for the Ritual of Registration.");
	init_special_item(1,"Blades of Avernum License","A token given to you after completion of the Ritual of Registration.");

	break;

// This is the state that is called only once at the very beginning of 
// the scenario. Some things that should go here:
//    The stuff in shops.
//    Creating horses and boats.
beginstate START_SCEN_STATE;
	// Initialize a few shops.
	
	// Shop 0 - armor
	add_item_to_shop(0,25,25);
	add_item_to_shop(0,26,20);
	add_item_to_shop(0,30,20);
	add_item_to_shop(0,31,10);
	add_item_to_shop(0,35,10);
	add_item_to_shop(0,121,15);
	add_item_to_shop(0,122,15);
	add_item_to_shop(0,126,3);
	add_item_to_shop(0,131,2);
	add_item_to_shop(0,111,15);
	add_item_to_shop(0,16,10);
	add_item_to_shop(0,136,10);
	add_item_to_shop(0,137,10);
	add_item_to_shop(0,141,5);
	
	// Shop 1 - weapons
	add_item_to_shop(1,45,25);
	add_item_to_shop(1,46,20);
	add_item_to_shop(1,50,15);
	add_item_to_shop(1,51,10);
	add_item_to_shop(1,55,5);
	add_item_to_shop(1,65,20);
	add_item_to_shop(1,66,10);
	add_item_to_shop(1,70,5);
	
	// Shop 2 - tools
	add_item_to_shop(2,170,500);
	add_item_to_shop(2,171,500);
	add_item_to_shop(2,172,30);
	add_item_to_shop(2,174,500);
	add_item_to_shop(2,177,500);
	
	// Shop 3 - missiles
	add_item_to_shop(3,85,500);
	add_item_to_shop(3,86,10);
	add_item_to_shop(3,90,10);
	add_item_to_shop(3,95,3);
	add_item_to_shop(3,100,20);
	add_item_to_shop(3,101,10);
	add_item_to_shop(3,105,10);

	// Shop 4 - potions
	add_item_to_shop(4,220,4);
	add_item_to_shop(4,221,3);
	add_item_to_shop(4,222,3);
	add_item_to_shop(4,223,2);

	// Shop 5 - food
	add_item_to_shop(5,4,500);
	add_item_to_shop(5,6,500);
	add_item_to_shop(5,7,500);

	toggle_quest(0,1); //give quest
break;

// This state is called every tick wherever the party is in the scenario.
// You can use the set_state
beginstate START_STATE;

break;

// Place your own states below. Give each a number at least 10.
beginstate 10;
	message_dialog("BLADES OF AVERNUM - Welcome to the world of Blades of Avernum! You are about to create a band of adventurers and take them out on exciting adventures.","You will meet people, accept quests, solve puzzles, and fight many exotic and cunning foes. You will gain wealth and power and, hopefully, fame (or infamy).");
break;

beginstate 11;
	message_dialog("INTRODUCTION TO SCENARIO DESIGN - Welcome to the Blades of Avernum Scenario Editor! The Blades of Avernum system enables you to make fantasy role-playing adventures of great detail and complexity. And, hopefully, fun.","It is a demanding program, and creating the next great adventure is not for the faint of heart. However, with time and ingenuity, you can create stories that will captivate Blades of Avernum fans all over the world.");
break;

beginstate 12;
	reset_dialog();
	add_dialog_str(0,"This is a pretty straightforward form. It asks the basic personal questions: name, residence, payment method, etc.",0);
	add_dialog_str(1,"You could fill this out pretty quickly right now, if you wanted.",0);
	add_dialog_choice(0,"Fill it out now.");
	add_dialog_choice(1,"Wait until later.");
	choice = run_dialog(0);
	if (choice == 1){
		if (has_item(194)){
			message_dialog("You fill out the form. Unsurprisingly, it's not that difficult.","");
			take_item(447);
			change_spec_item(0,1);
			award_party_xp(5,1);
		}
		else message_dialog("You need a pen and ink to fill out this form.","");
	}
	if (choice == 2)
		message_dialog("Y-you're waiting? Um, okay... whatever...","");
break;

beginstate 13;
	reset_dialog_preset_options(0);
	add_dialog_str(0,"SPIDERWEB EPISODE 1 - ATTACK OF THE NOOBS",0);
	add_dialog_str(1,"It was a quiet time for the Spiderweb Software Message Boards. Sure, there were a few noobs to put up with now and then, but overall the boards were a peaceful, welcoming place (after one's sanity was left safely at the door, of course).",0);
	add_dialog_str(2,"Then the Spiderwebbers learned that an army of noobs was coming to change the course of the boards forever...",0);
	choice = run_dialog(0);
	if (choice == 1)
		end();
break;

beginstate 14;
	reset_dialog_preset_options(0);
	add_dialog_str(0,"SPIDERWEB EPISODE 2 - RETURN OF THE SPIDERWEBBERS",0);
	add_dialog_str(1,"The Spiderwebbers lost the war. And yet, there is still hope for the Spiderweb Software Message Boards. It may be possible to bring them all back.",0);
	add_dialog_str(2,"Unfortunately, the Spiderwebbers must also face another menacing foe in order to reclaim the boards...",0);
	choice = run_dialog(0);
	if (choice == 1)
		end();
break;

beginstate 15;
	reset_dialog_preset_options(0);
	add_dialog_str(0,"SPIDERWEB EPISODE 3 - A NEW GAME",0);
	add_dialog_str(1,"It's been two months since the thing was banished from the Spiderweb Software Message Boards. Since then, things have been quiet. A little too quiet.",0);
	add_dialog_str(2,"Several people left the boards to recuperate from the recent experiences and never came back. The remaining members haven't said or done anything notable since then.",0);
	add_dialog_str(3,"Is there anything that can attract new members and get the old members talking again, or are the boards and everyone on them doomed to fade into obscurity?",0);
	choice = run_dialog(0);
	if (choice == 1)
		end();
break;

beginstate 16;
	reset_dialog_preset_options(0);
	add_dialog_str(0,"SPIDERWEB EPISODE 4 - SPIDERWEB RELOADED",0);
	add_dialog_str(1,"A disaffected member who left Spiderweb a long time ago returns with plans for an army of killer bots and revenge. Huh. You'd think the Spiderwebbers would have remembered this guy.",0);
	choice = run_dialog(0);
	if (choice == 1)
		end();
break;

beginstate 17;
	reset_dialog_preset_options(0);
	add_dialog_str(0,"SPIDERWEB EPISODE 4 - SPIDERWEB RESISTANCE",0);
	add_dialog_str(1,"Ecksian builds up his army. The rats debate their options. Spiderweb prepares for battle. Student of Trinity and Nikki set out to prevent the war from ever happening. And power threatens to fall into the wrong hands...",0);
	choice = run_dialog(0);
	if (choice == 1)
		end();
break;

beginstate 18;
	reset_dialog();
	add_dialog_str(0,"Shadow Vale Forum Rules:",0);
	add_dialog_str(1," ",0);
	add_dialog_str(2," ",0);
	add_dialog_str(3," ",0);
	add_dialog_str(4," ",0);
	add_dialog_str(5," ",0);
	add_dialog_str(6," ",0);
	add_dialog_str(7," ",0);
	add_dialog_str(8," ",0);
	add_dialog_str(9," ",0);
	add_dialog_str(10," ",0);
	add_dialog_choice(0,"Hah!");
	choice = run_dialog(1);
	if (choice == 1)
		end();
break;

beginstate 19;
	message_dialog("NETHERGATE: RESURRECTION - Welcome to the exciting and savage world of ancient Britannia!","In Nethergate: Resurrection, a historical fantasy role-playing game from Spiderweb Software, you will play a band of powerful Roman soldiers or savage Celts.");
break;

beginstate 20;
	large_draw_pic_dialog(530,"Slarty vs. Desk");
break;